<?php

/**
* @current userintegral.php
* @author   CaoQiCheng <caoqicheng@haibao.com>
* @date 2016年8月26日 上午10:01:25
*/

namespace haibao\user\data;

class UserIntegral extends \haibao\user\data\BaseMysql {
 	
	public function __construct() {
        parent::__construct ( '\haibao\user\model\data\UserIntegral' );
        $this->setConfig( \haibao\classlibrary\www\Config::CLASSLIBRARY_CONFIG_MYSQL_HAIBAO_USER );
    }
    
    /**
     * 最新用户添加积分
     */
    public function addUserScore($userId,$userIntegral){
    	$sql="update UserIntegral set Integrals=Integrals+$userIntegral where UserId = %s";
    	$this->query($sql,array($userId));
    	return $userIntegral;
    }
   

}
